<!--
 * @Author: wwssaabb
 * @Date: 2021-11-24 10:19:03
 * @LastEditTime: 2021-11-24 10:48:44
 * @FilePath: \handwritten-code\css\三角.html
-->

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    body {
      width: 100vw;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .container {
      width: 50vw;
      height: 20vw;
      border-radius: 10px;
      display: flex;
      justify-content: space-evenly;
      flex-wrap: wrap;
    }

    .item {
      width: 0;
      height: 0;
    }

    .triangle1 {
      width: 0;
      height: 0;
      border-left: 50px solid red;
      border-top: 50px solid blue;
      border-right: 50px solid green;
      border-bottom: 50px solid yellow;
    }

    .triangle2 {
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
      border-top: 50px solid blue;
    }

    .triangle3 {
      border-right: 50px solid green;
      border-top: 50px solid transparent;
      border-bottom: 50px solid transparent;
    }

    .triangle4 {
      border-bottom: 50px solid yellow;
      border-left: 50px solid transparent;
      border-right: 50px solid transparent;
    }

    .triangle5 {
      border-left: 50px solid red;
      border-bottom: 50px solid transparent;
      border-top: 50px solid transparent;
    }

    .triangle6 {
      border-left: 50px solid transparent;
      border-top: 50px solid red;
    }

    .triangle7 {
      border-left: 50px solid blue;
      border-top: 50px solid transparent;
    }

    .triangle8 {
      border-right: 50px solid transparent;
      border-top: 50px solid blue;
    }

    .triangle9 {
      border-right: 50px solid blue;
      border-top: 50px solid transparent;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="triangle1 item"></div>
    <div class="triangle2 item"></div>
    <div class="triangle3 item"></div>
    <div class="triangle4 item"></div>
    <div class="triangle5 item"></div>
    <div class="triangle6 item"></div>
    <div class="triangle7 item"></div>
    <div class="triangle8 item"></div>
    <div class="triangle9 item"></div>
  </div>
</body>

</html>